package com.ctgu.simplespringboot.service.UserServiceImpl;

import com.ctgu.simplespringboot.Entity.User;
import com.ctgu.simplespringboot.dao.UserDao;
import com.ctgu.simplespringboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public void save(User user) {
        userDao.save(user);
    }

    @Override
    public User login(String username, String password) {
       return userDao.findByUsernameAndPassword(username,password);
    }
}
